 package com.cxl.other.mode;
 
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.net.ServerSocket;
 import java.net.Socket;
 
 public class MyServer extends Thread
 {
   private Socket cq;
 
   public MyServer(Socket cq)
   {
     this.cq = cq;
   }
   public void run() { try { BufferedReader in = new BufferedReader(new InputStreamReader(this.cq.getInputStream()));
       PrintWriter out = new PrintWriter(this.cq.getOutputStream());
       String str;
       do {
         str = in.readLine();
         System.out.println(str);
         out.println("server--message: " + str);
         out.flush();
       }while (!str.equals("exit"));
     } catch (IOException localIOException)
     {
     }
   }
 
   public static void main(String[] args)
     throws IOException
   {
     ServerSocket server = new ServerSocket(8009);
     while (true) {
       Socket s = server.accept();
       new MyServer(s).start();
     }
   }
 }

/* Location:           E:\work\eclipse3.6_\workspace\design_pattern\
 * Qualified Name:     com.cxl.other.mode.MyServer
 * JD-Core Version:    0.6.1
 */